home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c
- Subject: Re: Parsing filenames
- Date: 20 Apr 1996 06:05:00 GMT
- Organization: systems hk
- Message-ID: <4l9uqc$2ce@nadine.teleport.com>
- References: <3176CFFD.6723@central.co.nz>
- NNTP-Posting-Host: ip-pdx18-35.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- Alan Howard <duck@central.co.nz> wrote:
- >I am copying shareware files from a CD to a HDD to compile a CD-R of my
- >own full of back-up info. The files in question are ex Amiga 1200 an all
- >have long filenames full of illegal spaces (0x20) and asterisks...
- >MS-Dos truncates the long filenames into 8.3 but leaves duplicates in
- >each dir ie, 'robots in the park' and 'robots in the garden' both convert
- >to 'robots i'.
- [snip]
- >Can anyone help me get around this problem. How do I open an illegally
- >named file and then transfer the data associated with it from A to B???
- >How are the dir entries formatted, How can I find a specific entry, look
- >in it, find the beginning cluster for an arbitrary file, convert this
- >info to C function calls and shift the data??????
- >
- Alan,
-
- My advice would be to lose the original names, because you'll spend
- most of your time trying to encode them to readable 8.3 alternatives.
-
- If you can get each file open, then open it, create a new file with
- a unique name (increment a counter?), copy the contents from the
- original to the new file (byte by byte, in binary mode), close both
- files.
-
- Write the original name and new name to a text file, for later decoding.
-
- Yours, Geoff Houck
-
-